import time

from commons.yaml_util import read_yaml_key


class DebugTalk:

    @staticmethod
    def read_extract(key: str):
        """
        读取 extract.yaml 文件中，指定关键字的值
        :param key: 需要取值的关键字
        :return: 返回关键字对应的值，如果没有值，返回字符串“null”
        """
        path = "./testcases/extract.yaml"
        value = read_yaml_key(path, key)
        if value:
            return value
        else:
            return "null"

    @staticmethod
    def get_times():
        """
        获取当前时间戳
        """
        return int(time.time())
